from DynamicScheduling import DynamicScheduling


def run(filename):
    DS = DynamicScheduling()

    DS.readCode(filename)

    print("Program".center(100, "-"))
    for ist in DS.instructions:
        print(f"\t{ist:20}")

    print("Instructions Split".center(100, "-"))
    for istSplit in DS.instructionsSplitList:
        print(f"{istSplit}")

    print("DAG graph".center(100, "-"))
    DS.BuildDAG(DS.instructionsSplitList)
    DS.PrintDAG(DS.graphDAG)

    print("Runing Status".center(100, "-"))
    DS.PrintScheduledInstructions()

    print("Stall Times Graph".center(100, "-"))
    DS.PrintDAG(DS.stallTimes)
    pass


if __name__ == '__main__':
    run("./code/code4.txt")
